-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor issue filter (labels, poster, assignee) #32771
Conversation
a3bcc28
to
7afa821
Compare
7afa821
to
0dcb4a1
Compare
60f66c5
to
8e961fa
Compare
8e961fa
to
f84d018
Compare
Major work is done, ready for review |
60efb57
to
1dbd446
Compare
var s string | ||
if len(a)%2 == 1 { | ||
if v, ok := a[0].(string); ok { | ||
if v == "" || (v[0] != '?' && v[0] != '&') { | ||
panic("queryBuild: invalid argument") | ||
panic("QueryBuild: invalid argument") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to panic? Is it possible to recover from a panic if necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need to panic?
Yes. Golang also does so.
Is it possible to recover from a panic if necessary?
No
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a user's perspective, no one wants to cause the entire system to panic because of a query. I think this is unreasonable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a user's perspective, no one wants to cause the entire system to panic because of a query. I think this is unreasonable.
There are a variety of operations in Golang that may cause a panic. For this case, I think it is the developer's responsibility to check and ensure that the query does not cause a panic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a user's perspective, no one wants to cause the entire system to panic because of a query. I think this is unreasonable.
No, it won't panic from "user's perspective". It only panics for developer's mistakes.
It is designed carefully and intentionally, I won't change it unless you could show a real case why end users would be affected.
* origin/main: Fix internal server error when updating labels without write permission (go-gitea#32776) Fix wiki ui (go-gitea#32781) Change typescript `module` to `nodenext` (go-gitea#32757) Refactor issue filter (labels, poster, assignee) (go-gitea#32771) Make RepoActionView.vue support `##[group]` (go-gitea#32770) [skip ci] Updated translations via Crowdin
* giteaofficial/main: [skip ci] Updated translations via Crowdin Use batch database operations instead of one by one to optimze api pulls (go-gitea#32680) Fix internal server error when updating labels without write permission (go-gitea#32776) Fix wiki ui (go-gitea#32781) Change typescript `module` to `nodenext` (go-gitea#32757) Refactor issue filter (labels, poster, assignee) (go-gitea#32771)
Rewrite a lot of legacy strange code, remove duplicate code, remove jquery, and make these filters reusable.
Let's forget the old code, new code affects:
Next plan: add the user filter and label filter to other pages, eg: user/org home issue list